﻿using System;
using System.Collections.Generic;
using System.Windows;
using MathematicallySafe.HeadCounter.Data;
using MathematicallySafe.HeadCounter.Data.Common;
using MathematicallySafe.HeadCounter.Data.Models;

namespace MathematicallySafe.HeadCounter.Services.Forums
{
    public class ForumPostingService : IForumPostingService
    {
        private ForumRaidPosting _forumRaidPosting;
        private ForumRaiderPosting _raiderPosting;

        public ForumPostingService(IForumFormatter format)
        {
            _raiderPosting = new ForumRaiderPosting(format);
            _forumRaidPosting = new ForumRaidPosting(format);
        }

        public void PostGuildSummary(IEnumerable<Raider> raiders)
        {
            string post = "";
            raiders.ForEach(r => post += _raiderPosting.Generate(r));

            Clipboard.SetDataObject(post);
        }

        public void PostRaid(Raid raid)
        {
            Clipboard.SetDataObject(_forumRaidPosting.Generate(raid));
        }

        public void PostRaider(Raider raider)
        {
            Clipboard.SetDataObject(_raiderPosting.GenerateAll(raider));
        }

        public void PostRaiderGear(Raider raider)
        {
            Clipboard.SetDataObject(_raiderPosting.GenerateGear(raider));
        }

        public void PostRaiderAttendance(Raider raider)
        {
            Clipboard.SetDataObject(_raiderPosting.GenerateHistory(raider));
        }
    }
}


